Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/eliminate warnings #990

Merged
merged 30 commits into from
Oct 20, 2023
Merged

Fix/eliminate warnings #990

merged 30 commits into from
Oct 20, 2023

Conversation

p-snft
Copy link
Member

@p-snft p-snft commented Oct 11, 2023

There are a lot of FutureWarnings partly from imported packages but also due to our own prepared API changes. This PR is meant to adapt to these (planned) changes.

p-snft and others added 4 commits October 11, 2023 13:16
The test seems to be designed to test if warnings can be turned off.
However, the operation never created one.
@p-snft
Copy link
Member Author

p-snft commented Oct 13, 2023

The test just fails because Zenodo is down. I think, it's ready for review.

Comment on the two reverted commits: First, I decided to suppress warnings about experimental features, as they don't add value: We test them and do not need to be warned they are used unintentionally. However, there were issues with that, as not all tests were run because of this. So, I decided to keep the warnings.

@p-snft p-snft marked this pull request as ready for review October 13, 2023 13:02
@p-snft p-snft requested a review from jokochems October 13, 2023 13:02
docs/usage.rst Outdated Show resolved Hide resolved
@fwitte
Copy link
Member

fwitte commented Oct 13, 2023

I'd say everything looks fine here, thank you!

One note on using pytest.approx: The checks for the integers seem fine, what about the others? Some compare to 0.1 deviation, bevore it was rounded to 1 decimal, which would be 0.05 right? That is really the only thing that could be changed if necessary.

@p-snft
Copy link
Member Author

p-snft commented Oct 13, 2023

One note on using pytest.approx: The checks for the integers seem fine, what about the others? Some compare to 0.1 deviation, bevore it was rounded to 1 decimal, which would be 0.05 right? That is really the only thing that could be changed if necessary.

By default, pytest.approx takes a relative accuracy of 1e-6 and an absolute accuracy of 1e-12. If the test offers that accuracy, I did not weaken the test on purpose.

@p-snft
Copy link
Member Author

p-snft commented Oct 16, 2023

Decreased coverage is decreased because I deleted lines. I hope this is in order.

@jokochems
Copy link
Member

Thank you, @p-snft! I must admit that I overlooked this PR as I was quite busy with other developments. I'll add my review shortly.

p-snft and others added 3 commits October 16, 2023 19:34
As described in #979, timeincrement currently needs to be set for
multi period optimisation models.
Copy link
Member

@jokochems jokochems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, @p-snft and sorry for me taking quite some time for the review. I'm happy to approve. Also, I resolved some conflicts that were introduced by my last feature and detected and resolved one bug in the course of doing so that was neither detected by the test nor by me (please see my comment on this one).

Comment on lines +76 to +79
timeindex=timeindex,
timeincrement=[1] * len(timeindex),
periods=[timeindex],
infer_last_interval=False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you where looking to explicitly set infer_last_interval.

I noticed that this test was somewhat outdated since I used the old periods definition (type dict) here which I fixed in #977 which I just merged.

Another thing is that though it was syntactically correct with the list attribute as in the current dev branch, it would not have worked to set up a model this way. Since the test is only to demonstrate a warning that occurs before the model setup, I'm sorry that have not detected this. Anyways, as it is now, also the model build would work.

Concerning the (not so nice) inconsistency to be resolved some day, see #979.

@p-snft p-snft merged commit 29822da into dev Oct 20, 2023
14 checks passed
@p-snft p-snft deleted the fix/eliminate_warnings branch October 20, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants